package com.ruoyi.utils;



import com.ruoyi.domain.SysCoalMachine;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Component
public class MeasuringPointValueUtils {

    public static void eastValue(SysCoalMachine sysCoalMachine) {

        BigDecimal offset = sysCoalMachine.getDrft().multiply(BigDecimal.valueOf(1000));

//高程
        double dtfv = Math.toRadians(sysCoalMachine.getDrfV().doubleValue());
        //水平
        double dtfH = Math.toRadians(sysCoalMachine.getDrfH().doubleValue());
        BigDecimal east = offset.multiply(BigDecimal.valueOf(Math.sin(dtfH)));
       sysCoalMachine.setEastCount(east);
        BigDecimal north = offset.multiply(BigDecimal.valueOf(Math.cos(dtfH)));
      sysCoalMachine.setNorthCount(north);
        BigDecimal high = offset.multiply(BigDecimal.valueOf(Math.sin(dtfv))) ;
       sysCoalMachine.setHighCount(high);

    }
}

